{template 'common/header'}
<script type="text/javascript" src="../addons/zsk_award/js/common.js"></script>
<div>
<div class="panel panel-info">
	<div class="panel-heading" style="text-align: center;">奖项管理</div>
	<div class="panel-body">
		<div class="row">
			<form action="<?php  echo $this->createWebUrl('awardsearch');?>" method="post" id="keyform">
			<div class="col-xs-6 col-sm-4">
				<input type="text" name="key" placeholder="活动名称" value="{$param['key']}" class="form-control" style="display: inline-block;" /></div>
			</form>
			<div class="col-xs-6 col-sm-4">
				<button class="btn btn-default" style="display: inline-block;" onclick="search()" form="keyform">搜索</button>  

				<button class="btn btn-default" style="display: inline-block;" onclick="awardadd()">奖项设置</button>
			<div class="clearfix visible-xs-block"></div>
			<div class="col-xs-6 col-sm-4"> </div>
			
		</div> 
	</div>
</div>
<table class="table table-bordered">
	<thead>
		<tr>
		    <th style="width: 100px;">活动名称</th> 
			<th style="width: 100px;">一等奖</th> 
			<th style="width: 100px;">二等奖</th>
			<th style="width: 100px;">三等奖</th>
			<th style="width: 100px;">是否显示奖品数量</th> 
			<th style="width: 100px;">每人最多允许抽奖次数</th>
			<th style="width: 100px;">每天抽奖次数</th>
			<th style="width: 220px;">操作</th>
		</tr>
	</thead>
	<tbody>
		{loop $result $index $item}
		<tr>
		    <td>{$item['activityname']}</td>
			<td>{$item['award1']}</td>
			<td>{$item['award2']} </td>
			<td>{$item['award3']} </td>
			<td><?php if($item['is_use']==1){echo '是';}else{echo '否';}?></td>
			<td>{$item['maxnumberp']}</td>
			<td>{$item['maxnumberd']}</td>
			<td>
				<a href="<?php echo $this->createWebUrl('awardEdit',array('awardid'=>$item['awardid']));?>" >修改</a>
				<a onclick="reset()" >删除</a>
				<a href="<?php echo $this->createWebUrl('awardDetail',array('awardid'=>$item['awardid']));?>" >详细信息</a>
			</td>
		</tr>
		{/loop}
		<tr>
			<td colspan="8" align="center">
				{$page}
			</td>
		</tr>
	</tbody>

</table>
 
</div>

<script type="text/javascript">
	function awardadd(){
		window.location.href="<?php  echo $this->createWebUrl('awardadd');?>";
	}
	function search(){
		window.location.href="<?php  echo $this->createWebUrl('awardsearch');?>";
	}
	function reset(){
		modalDlg("确定要删除吗？",function(){
		window.location.href="<?php echo $this->createWebUrl('DeleteAward',array('awardid'=>$item['awardid']));?>";
		});
	}
</script>
{template 'common/footer'}
